#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int missingNumber(int* nums, int numsSize) {
    int sum = 0;
    for (int i = 0; i <= numsSize; i++)
    {
        sum += i;
    }
    for (int i = 0; i < numsSize; i++)
    {
        sum -= nums[i];
    }
    return sum;
}
int main()
{
	int arr[] = { 9,6,4,2,3,5,7,0,1 };
	int len = sizeof(arr) / sizeof(arr[0]);
    printf("%d", missingNumber(arr, len));
	return 0;
}
